<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>JavaScript Benchmark: looping</title>
    <script type="text/javascript" src="benchmarker.js"></script>
    <script type="text/javascript">
      new Benchmarker(
        {
          lazy: function() {
            for (var i = 0; i < this.array.length; i++)
              var k = this.array[i];
          },
          clean: function() {
            for (var i = 0, len = this.array.length; i < len; i++)
              var k = this.array[i];
          },
          notHigh: function() {
            for (var i = 0, len = this.array.length; i !== len; i++)
              var k = this.array[i];
          },
          reverse: function() {
            for (var i = this.array.length - 1; i >= 0; i--)
              var k = this.array[i];
          },
          reverseR: function() {
            for (var i = this.array.length; --i >= 0;)
              var k = this.array[i];
          },
          reverse0: function() {
            for (var i = this.array.length; i > 0; i--)
              var k = this.array[i-1];
          },
          reverseB: function() {
            for (var i = this.array.length; !!i; i--)
              var k = this.array[i-1];
          }
        },
        {
          atInit: function() {
            this.array = (1).range(10); // how long?
          }
        }
      );
    </script>
  </head>
  <body>
  </body>
</html>
